package day06;

import com.sun.org.apache.xml.internal.resolver.helpers.PublicId;

import java.security.PublicKey;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/2/17
 **/
public class sj {
    public static void main(String[] args) {
        sayo("wuxie");
        sayo("xyh");
        sayhi("hyj", 28);
        sayhi("zql", 42);
        sayHello("lbw",60);

        say();
        System.out.println("继续执行");
        int b = plus(5, 6);
        System.out.println(b);
        int m = 5, n = 6;
        int c = plus(m, n);
        System.out.println(c);
        int[] d = tesarray(5, 100);
        System.out.println("数组的长度为" + d.length);
        int[] e = tesarray(8, 20);
        System.out.println("第一个元素的值为:" + e[0]);
        for (int i = 0; i < e.length; i++) {
            System.out.println(e[i]);

        }
    }

        public static double getNum () {
            return 8.88;
        }

        public static int plus ( int num1, int num2){
            int num = num1 + num2;
            return num;
        }

        public static void sayhi (String name,int age){
            System.out.println("大家好,我叫" + name + ",今年42岁了");
        }

        public static void sayo (String name){
            System.out.println("大家好我叫" + name + "今年39岁了");
        }

        public static void say () {
            System.out.println("大家好,我叫XL.今年28岁了");
            double a = getNum();
            System.out.println(a);
        }

        public static int[] tesarray ( int len, int max){
            int[] arr = new int[len];
            for (int i = 0; i < arr.length; i++) {
                arr[i] = (int) (Math.random() * (max + 1));
            }
            return arr;
        }

        public static void sayHello (String name,int age){
            if (age>60) {
                return;}
                System.out.println("大家好我叫"+name+",今年"+age+"岁了");
            }

        }






